import request from '@/utils/request'

/**
 * 图像镜像接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {number} type - 图像方向类型(0-不需要，1-中心旋转，2-上下镜像，3-左右镜像) (Required).
 * @returns {Promise<object>} A promise resolving with the API response.
 * --- Response Properties (resolved object) ---
 * @property {number} code - 错误码.
 * @property {string} message - 错误信息.
 */
export function rotate(data) {
  return request({
    url: '/api/image/rotate',
    method: 'post',
    data: data
  })
}
export function postMeasureSwitchState(data) {
  return request({
    url: '/api/measure/measureSwitchState',
    method: 'post',
    data: data
  })
}
export function getMeasureSwitchState() {
  return request({
    url: '/api/measure/measureSwitchState',
    method: 'get'
  })
}

/**
 * 图像坏点矫正接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {number} mode - 1-添加矫正点，2-删除矫正点，3-保存矫正点 (Required).
 * @property {number} pointx - 坐标X (Required).
 * @property {number} pointy - 坐标Y (Required).
 * @returns {Promise<object>} A promise resolving with the API response.
 * --- Response Properties (resolved object) ---
 * @property {number} ruleVal - 色标值.
 */
export function correctbadpixel(data) {
  return request({
    url: '/api/image/correctBadpixel',
    method: 'post',
    data: data
  })
}
export function saveBadpixel(data) {
  return request({
    url: '/api/image/saveBadpixel',
    method: 'post',
    data: data
  })
}
export function addBadpixel(data) {
  return request({
    url: '/api/image/addBadpixel',
    method: 'post',
    data: data
  })
}
export function cancelBadpixel(data) {
  return request({
    url: '/api/image/cancelBadpixel',
    method: 'post',
    data: data
  })
}
export function badpixelMove(data) {
  return request({
    url: '/api/image/badpixelMove',
    method: 'post',
    data: data
  })
}
export function badpixelMode(data) {
  return request({
    url: '/api/image/badpixelMode',
    method: 'post',
    data: data
  })
}
export function getbadpixelMode() {
  return request({
    url: '/api/image/badpixelMode',
    method: 'get'
  })
}
export function clearBadpixel() {
  return request({
    url: '/api/image/clearBadpixel',
    method: 'post'
  })
}

/**
 * 用户注册接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {number} type - 0-正向，1-反向 (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function direction(data) {
  return request({
    url: '/api/image/direction',
    method: 'post',
    data: data
  })
}

/**
 * 图像算法参数接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {number} ddr - 引导滤波参数（推荐10-80,0表示关闭） (Required).
 * @property {number} dde - 细节增强倍数（推荐2-10,0表示关闭） (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function enhancementparam(data) {
  return request({
    url: '/api/image/enhancementParam',
    method: 'post',
    data: data
  })
}

/**
 * 测温档位接口
 * @param {object|undefined} [query] - Optional query parameters.
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function temprange(query) {
  return request({
    url: '/api/image/tempRange',
    method: 'get',
    params: query
  })
}

/**
 * 图像降噪接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {number} frameNoiseReduceLevel - 空域降噪级别（0-20） (Required).
 * @property {number} interFrameNoiseReduceLevel - 时域降噪级别（0-20） (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function noisereduce(data) {
  return request({
    url: '/api/image/noiseReduce',
    method: 'post',
    data: data
  })
}

/**
 * 调色板接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {string} rulerVal - Ironbow(&quot;铁红&quot;),Steel(&quot;钢铁&quot;),Amber(&quot;琥珀&quot;),Rainbow(&quot;彩虹&quot;),CopperBrown(&quot;铜棕色&quot;),HighContrast(&quot;高对比&quot;),HighRainbow(&quot;高彩虹&quot;),YellowGreen(&quot;黄绿色&quot;), WhiteHeat(&quot;白热&quot;),BlackHeat(&quot;黑热&quot;),Medical(&quot;医疗&quot;),Arctic(&quot;北极&quot;),Color1(&quot;颜色1&quot;),Color2(&quot;颜色2&quot;),Color3(&quot;颜色3&quot;),Ironbow1(&quot;铁红1&quot;),Colorful(&quot;多彩&quot;), (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function palettes(data) {
  return request({
    url: '/api/image/palettes',
    method: 'post',
    data: data
  })
}

/**
 * 显示参数调节接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {number} brightness - 亮度（0-100） (Required).
 * @property {number} contrast - 对比度（0-100） (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function displayparam(data) {
  return request({
    url: '/api/image/displayParam',
    method: 'post',
    data: data
  })
}

/**
 * OSD叠加接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {number} showChannelName - 显示名称（0-不显示，1-显示） (Required).
 * @property {number} showDatetime - 显示日期（0-不显示，1-显示） (Required).
 * @property {number} showWeekday - 显示星期（0-不显示，1-显示） (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function osdsettings(data) {
  return request({
    url: '/api/image/basicOsdSetting',
    method: 'post',
    data: data
  })
}

/**
 * 云台控制接口（透传）
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {string} cmd - ptz命令 (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function transparentcmd(data) {
  return request({
    url: '/api/control/transparentCmd',
    method: 'post',
    data: data
  })
}

/**
 * 云台控制-预置点配置接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {string} cmd - 命令（Set/Clear/Call） (Required).
 * @property {number} id - 预置点ID（1-255） (Required).
 * @property {string} name - 预置点名称（最大64位） (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function preset(data) {
  return request({
    url: '/api/control/preset',
    method: 'post',
    data: data
  })
}

/**
 * 云台控制-方向（非透传）
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {string} cmd - 方向（Up/Down/Left/Right/UpLeft/UpRight/DownLeft/DownRight） (Required).
 * @property {number} speed - 速度 (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function direct(data) {
  return request({
    url: '/api/control/direct',
    method: 'post',
    data: data
  })
}

/**
 * 云台控制-缩放
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {string} cmd - 缩放(In/Out/Stop) (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function zoom(data) {
  return request({
    url: '/api/control/zoom',
    method: 'post',
    data: data
  })
}

/**
 * 云台控制-聚焦
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {string} cmd - 聚焦(Auto/Far/Near/Stop) (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function controlfocus(data) {
  return request({
    url: '/api/control/focus',
    method: 'post',
    data: data
  })
}

/**
 * 停止接口
 * @param {object} data - Request payload (Structure not specified)
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function controlstop() {
  return request({
    url: '/api/control/stop',
    method: 'post'
  })
}

/**
 * 预置位查询接口
 * @param {object} data - Request payload (Structure not specified)
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function querypreset() {
  return request({
    url: '/api/control/queryPreset',
    method: 'post',
  })
}export function backgroundCorrect() {
  return request({
    url: '/api/image/backgroundCorrect',
    method: 'post',
  })
}export function manualCorrect() {
  return request({
    url: '/api/image/manualCorrect',
    method: 'post',
  })
}

/**
 * 设置点测温参数接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {string} operate - 操作类型(add,update,del) (Required).
 * @property {number} id - 点编号 (Required).
 * @property {number} coordX - x坐标 (Required).
 * @property {number} coordY - y坐标 (Required).
 * @property {boolean} referFlag - 参考标记 (Required).
 * @property {boolean} validFlag - 有效标记 (Required).
 * @property {number} radiance100 - 辐射率[1~100] (Required).
 * @property {number} distance100 - 距离 (Required).
 * @property {number} temp100 - 温度 (Required).
 * @property {number} tempGain - 温度增益倍数[0~100] (Required).
 * @property {number} radTableSwitch - 辐射率/辐射表[0,1] (Required).
 * @property {number} radTableId - 辐射编号 (Required).
 * @property {number} radTableValue100 - 辐射值 (Required).
 * @property {string} name - 名称 (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function postMeasurepoint(data) {
  return request({
    url: '/api/measure/measurePoint',
    method: 'post',
    data: data
  })
}

/**
 * 设置线测温参数接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {number} id - 线测温编号[1~20] (Required).
 * @property {number} coordStartX - 坐标x (Required).
 * @property {number} coordStartY - 坐标y (Required).
 * @property {number} coordEndX - 终点坐标x (Required).
 * @property {number} coordEndY - 终点坐标y (Required).
 * @property {number} referFlag - 参考标记 (Required).
 * @property {number} validFlag - 有效标记 (Required).
 * @property {number} radiance100 - 辐射率100倍值[0~100] (Required).
 * @property {number} distance100 - 距离 (Required).
 * @property {number} tempType - 测温类型(0=最高温，1=最低温，2=平均温) (Required).
 * @property {number} reflectTemp100 - 反射温度 (Required).
 * @property {number} radTableSwitch - 辐射率表开关 (Required).
 * @property {number} radTableId - 辐射编号 (Required).
 * @property {number} radTableValue100 - 辐射值 (Required).
 * @property {number} referTempType - 参考温度类型[0:最高温1: 最低温 2:平均温] (Required).
 * @property {number} tempGain - 温度增益倍数(0-100倍 1-10倍) (Required).
 * @property {string} name - 名称 (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function measureline(data) {
  return request({
    url: '/api/measure/measureLine',
    method: 'post',
    data: data
  })
}

/**
 * 区域测温参数配置接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {number} id - 区域编号[1~20] (Required).
 * @property {number} coordX - 起点坐标x(左上角) (Required).
 * @property {number} coordY - 起点坐标y(左上角) (Required).
 * @property {number} rectWide - 区域的宽度 (Required).
 * @property {number} rectHigh - 区域的高度 (Required).
 * @property {boolean} referFlag - 参考标记 (Required).
 * @property {boolean} vaildFlag - 有效标记 (Required).
 * @property {number} radiance100 - 辐射率 (Required).
 * @property {number} distance100 - 辐射距离 (Required).
 * @property {number} reflectTemp100 - 反射温度 (Required).
 * @property {number} radTableSwitch - 类型(0-辐射率,1-辐射率表) (Required).
 * @property {number} radTableId - 辐射id (Required).
 * @property {number} radTableValue100 - 辐射值 (Required).
 * @property {number} tempType - 区域测温类型(0-最高温，1-最低温，2-平均温) (Required).
 * @property {number} referTempType - 参考测温类型(0-最高温,1-最低温, 2-平均温) (Required).
 * @property {string} name - 昵称 (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function postMeasurerect(data) {
  return request({
    url: '/api/measure/measureRect',
    method: 'post',
    data: data
  })
}

/**
 * 测温参数配置接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {number} radiance100 - 辐射率 (Required).
 * @property {number} distance100 - 距离 (Required).
 * @property {number} humidity100 - 相对湿度 (Required).
 * @property {number} reflectTemp100 - 加反射温度 (Required).
 * @property {number} transmission100 - 透射率100倍 (Required).
 * @property {number} ambientTempManu100 - 环境温度100倍 (Required).
 * @property {number} radTableSwitch - 辐射类型(0-辐射率,1-辐射率表) (Required).
 * @property {number} radTableId - id (Required).
 * @property {number} radTableValue100 - 辐射值 (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function measureparam(data) {
  return request({
    url: '/api/measure/measureParam',
    method: 'post',
    data: data
  })
}

/**
 * 获取点接口
 * @param {object|undefined} [query] - Optional query parameters.
 * @returns {Promise<object>} A promise resolving with the API response.
 * --- Response Properties (resolved object) ---
 * @property {number} id - 点测编号.
 * @property {number} coordX - 坐标x.
 * @property {number} coordY - 坐标y.
 * @property {number} referFlag - 参考标记[0,1].
 * @property {number} validFlag - 有效标记[0,1].
 * @property {number} radiance100 - 辐射率[1~100].
 * @property {number} distance100 - 距离.
 * @property {number} temp100 - 温度.
 * @property {number} tempGain - 温度增益倍数.
 * @property {number} radTableSwitch - 辐射类型.
 * @property {number} radTableId - 辐射id.
 * @property {number} radTableValue100 - 辐射值.
 * @property {number} name - 名称.
 */
export function getMeasurepoint(query) {
  return request({
    url: '/api/measure/measurePoint',
    method: 'get',
    params: query
  })
}

/**
 * 获取区域测温参数接口
 * @param {object|undefined} [query] - Optional query parameters.
 * @returns {Promise<object>} A promise resolving with the API response.
 * --- Response Properties (resolved object) ---
 * @property {number} id - 区域编号[1~20].
 * @property {number} coordX - 起点坐标x(左上角).
 * @property {number} coordY - 起点坐标y(左上角).
 * @property {number} rectWide - 区域的宽度.
 * @property {number} rectHigh - 区域的高度.
 * @property {number} referFlag - 参考标记.
 * @property {number} vaildFlag - 有效标记.
 * @property {number} radiance100 - 辐射率.
 * @property {number} distance100 - 辐射距离.
 * @property {number} reflectTemp100 - 反射温度.
 * @property {number} radTableSwitch - 类型(0-辐射率,1-辐射率表).
 * @property {number} radTableId - 辐射id.
 * @property {number} radTableValue100 - 辐射值.
 * @property {number} tempType - 区域测温类型(0-最高温，1-最低温，2-平均温).
 * @property {number} referTempType - 参考测温类型(0-最高温,1-最低温, 2-平均温).
 * @property {number} minTemp100 - 最低温100倍.
 * @property {number} maxTemp100 - 最高温100倍.
 * @property {number} avgTemp100 - 平均温100倍.
 * @property {number} maxTempCoordX - 最高温x坐标.
 * @property {number} maxTempCoordY - 最高温y坐标.
 * @property {number} minTempCoordX - 最低温x坐标.
 * @property {number} minTempCoordY - 最低温y坐标.
 * @property {string} name - 昵称.
 */
export function getMeasurerect(query) {
  return request({
    url: '/api/measure/measureRect',
    method: 'get',
    params: query
  })
}

/**
 * 获取/设置OSD参数
 * @param {object} [query] - Optional query parameters.
 * --- Request Properties (query) ---
 * @property {number} enabled - 是否开启测温 (Required).
 * @property {number} showColorRuler - 是否显示色标 (Required).
 * @property {number} showMaxTemp - 是否显示最高温 (Required).
 * @property {number} showMinTemo - 是否显示最低温 (Required).
 * @property {number} showAvgTemo - 是否显示平均温 (Required).
 * @property {number} showEmissivity - 是否显示辐射率 (Required).
 * @property {number} showRulerName - 是否显示规则名称 (Required).
 * @property {string} tempUnit - 温度单位 (Required).
 * @property {number} tempRange - 测温档位 (Required).
 * @property {string} tempAlgVersion - 测温算法版本 (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function basicconfig(query) {
  return request({
    url: '/api/measure/measureBasicConfig',
    method: 'post',
    data: query
  })
}
export function forceKeyFrame() {
  return request({
    url: '/api/video/forceKeyFrame',
    method: 'post'
  })
}
export function getbasicconfig(query) {
  return request({
    url: '/api/measure/measureBasicConfig',
    method: 'get',
    params: query
  })
}
export function thermalBasicConfig(query) {
  return request({
    url: '/api/measure/measureBasicConfig',
    method: 'post',
    data: query
  })
}
export function getthermalBasicConfig(query) {
  return request({
    url: '/api/measure/measureBasicConfig',
    method: 'get',
    params: query
  })
}
export function postmeasureRange(query) {
  return request({
    url: '/api/measure/measureRange',
    method: 'post',
    data: query
  })
}
export function measureRange(query) {
  return request({
    url: '/api/measure/measureRange',
    method: 'get',
    params: query
  })
}

/**
 * 测温报警配置接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {number} id - 点线框id (Required).
 * @property {string} type - 点线框类型（point,line,rect） (Required).
 * @property {string} rule - 规则（最高温高于-maxGreater，最高温低于-maxLesser, 最低温高于-minGreater, 最低温低于-minLesser, 平均温高于-avgGreater,平均温低于-avgLesser (Required).
 * @property {number} threshold - 容错温度(防止温度来回震荡) (Required).
 * @property {number} alert - 预警温度 (Required).
 * @property {number} alertFilterTime - 预警过滤时间 (Required).
 * @property {number} alarm - 报警温度 (Required).
 * @property {number} alarmFilterTime - 报警过滤时间 (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function postThermalalarmconfig(data) {
  return request({
    url: '/api/measure/measureAlarmConfig',
    method: 'post',
    data: data
  })
}

/**
 * 测温报警布防配置接口
 * @param {object} data - Request payload (Structure not specified)
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function alarmarmingconfig(data) {
  return request({
    url: '/api/measure/alarmArmingConfig',
    method: 'post',
    data: data
  })
}export function getalarmarmingconfig(data) {
  return request({
    url: '/api/measure/alarmArmingConfig',
    method: 'get',
    data: data
  })
}

/**
 * 获取测温报警配置接口
 * @param {object} [query] - Optional query parameters.
 * --- Request Properties (query) ---
 * @property {number} id - 点线框id (Required).
 * @property {string} type - 点线框类型(point/line/rect) (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function getThermalalarmconfig(query) {
  return request({
    url: '/api/measure/measureAlarmConfig',
    method: 'get',
    params: query
  })
}

/**
 * 测温报警联动接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {number} uploadCenter - 是否上传中心 (Required).
 * @property {number} outputIOPort - 是否联动输出到IO口 (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function thermalalarmtrigger(data) {
  return request({
    url: '/api/measure/measureAlarmTrigger',
    method: 'post',
    data: data
  })
}

/**
 * 获取设备信息接口
 * @param {object|undefined} [query] - Optional query parameters.
 * @returns {Promise<object>} A promise resolving with the API response.
 * --- Response Properties (resolved object) ---
 * @property {string} softVersion - 应用程序版本.
 * @property {string} hardVersion - 硬件版本.
 * @property {string} FPGAVersion - fpga程序版本.
 * @property {number} tempAlgVersion - 测温算法版本.
 * @property {number} imageAlgVersion - 图像算法版本.
 * @property {string} deviceModel - 设备型号.
 * @property {string} serialNumber - 设备序列号.
 * @property {string} productDate - 生产日期.
 * @property {string} startTime - 启动时间.
 */
export function deviceinfo(query) {
  return request({
    url: '/api/system/deviceInfo',
    method: 'get',
    params: query
  })
}

/**
 * 设置时间
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {string} timeMode - 时间模式(NTP/manual) (Required).
 * @property {string} timeZone - 时区 (Required).
 * @property {string} [localTime] - 设备时间(manual可选) (Optional).
 * @property {string} [ntpServerAddress] - ntp服务器地址(ntp校时使用) (Optional).
 * @property {number} [ntpServerPort] - ntp服务器端口(ntp校时使用) (Optional).
 * @property {number} [ntpSyncInterval] - ntp校时间隔(ntp校时使用) (Optional).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function postTime(data) {
  return request({
    url: '/api/system/time',
    method: 'post',
    data: data
  })
}

/**
 * 设置网络信息接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {string} addressType - 地址类型(static-静态,dhcp-动态dhcp) (Required).
 * @property {string} ipAddress - ip地址 (Required).
 * @property {string} subnetMask - 子网掩码 (Required).
 * @property {string} defaultGateway - 默认网关 (Required).
 * @property {string} primaryDNS - 首选DNS (Required).
 * @property {string} SecondaryDNS - 备选DNS (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function postNetconfig(data) {
  return request({
    url: '/api/system/netConfig',
    method: 'post',
    data: data
  })
}

/**
 * 获取网络地址信息接口
 * @param {object|undefined} [query] - Optional query parameters.
 * @returns {Promise<object>} A promise resolving with the API response.
 * --- Response Properties (resolved object) ---
 * @property {string} addressType - 地址类型，static-静态地址，dhcp-动态地址.
 * @property {string} ipAddress - 网络ip地址.
 * @property {string} subnetMask - 子网掩码.
 * @property {string} defaultGateway - 默认网关.
 * @property {string} primaryDNS - 首选DNS.
 * @property {string} secondaryDNS - 备选DNS.
 * @property {string} macAddress - MAC地址.
 */
export function getNetconfig(query) {
  return request({
    url: '/api/system/netConfig',
    method: 'get',
    params: query
  })
}

/**
 * 获取端口配置接口
 * @param {object|undefined} [query] - Optional query parameters.
 * @returns {Promise<object>} A promise resolving with the API response.
 * --- Response Properties (resolved object) ---
 * @property {number} svrPort - 应用程序监听端口.
 * @property {number} rtspPort - rtsp服务监听端口.
 */
export function getPortsconfig(query) {
  return request({
    url: '/api/system/portsConfig',
    method: 'get',
    params: query
  })
}

/**
 * 设置端口配置接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {number} svrPort - 应用监听端口 (Required).
 * @property {number} rtspPort - rtsp监听端口 (Required).
 * @property {number} httpPort - http监听端口 (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function postPortsconfig(data) {
  return request({
    url: '/api/system/portsConfig',
    method: 'post',
    data: data
  })
}

/**
 * 格式化sd卡接口
 * @param {object} data - Request payload (Structure not specified)
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function sdcardformat(data) {
  return request({
    url: '/api/system/sdcardFormat',
    method: 'post',
    data: data
  })
}

/**
 * 获取sd卡信息接口
 * @param {object|undefined} [query] - Optional query parameters.
 * @returns {Promise<object>} A promise resolving with the API response.
 * --- Response Properties (resolved object) ---
 * @property {number} groupid - 用户组id，1：超级管理员；2：普通用户.
 */
export function sdcardinfo(query) {
  return request({
    url: '/api/system/sdcardInfo',
    method: 'get',
    params: query
  })
}

/**
 * RS485参数配置
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {number} enable - 启用状态（0-关闭，1-开启） (Required).
 * @property {number} mode - 控制模式（0-透传，1-云台，2-LED） (Required).
 * @property {number} baudRate - 波特率（1200/2400/4800/9600/19200/38400/57600/115200） (Required).
 * @property {number} dataBits - 数据位（5/6/7/8） (Required).
 * @property {number} stopBits - 停止位（1/2） (Required).
 * @property {string} parityType - 奇偶校验(none/odd/even) (Required).
 * @property {string} flowCtrl - 流控(none) (Required).
 * @property {number} decAddr - 解码设备地址 (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function postRs485config(data) {
  return request({
    url: '/api/system/rs485Config',
    method: 'post',
    data: data
  })
}

/**
 * 获取485配置
 * @param {object|undefined} [query] - Optional query parameters.
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function getRs485config(query) {
  return request({
    url: '/api/system/rs485Config',
    method: 'get',
    params: query
  })
}

/**
 * 获取时区
 * @param {object|undefined} [query] - Optional query parameters.
 * @returns {Promise<object>} A promise resolving with the API response.
 * --- Response Properties (resolved object) ---
 * @property {string} timeMode - 时间模式（NTP/manual）.
 * @property {string} localTime - 设备时间.
 * @property {string} timeZone - 时区.
 * @property {string} ntpServerAddress - ntp服务器地址（ntp模式可选）.
 * @property {number} ntpServerPort - ntp服务器端口（ntp模式可选）.
 * @property {number} ntpSyncInterval - ntp校时间隔（ntp模式可选）.
 */
export function getTime(query) {
  return request({
    url: '/api/system/time',
    method: 'get',
    params: query
  })
}

/**
 * 系统重启接口
 * @param {object} data - Request payload (Structure not specified)
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function reboot(data) {
  return request({
    url: '/api/operations/reboot',
    method: 'post',
    data: data
  })
}

/**
 * 恢复出厂设置接口
 * @param {object} data - Request payload (Structure not specified)
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function restoredefaultsetting(data) {
  return request({
    url: '/api/operations/restoreDefaultSetting',
    method: 'post',
    data: data
  })
}

/**
 * 恢复设置接口
 * @param {object} data - Request payload (Structure not specified)
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function restoresetting(data) {
  return request({
    url: '/api/operations/restoreSetting',
    method: 'post',
    data: data
  })
}

/**
 * 升级应用程序接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {string} filename - 升级文件名 (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function upgradeapp(data) {
  return request({
    url: '/api/operations/upgradeApp',
    method: 'post',
    data: data
  })
}

/**
 * FPGA文件升级接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {string} filename - 文件名 (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function upgradefpga(data) {
  return request({
    url: '/api/operations/upgradeFpga',
    method: 'post',
    data: data
  })
}

/**
 * 定时自动重启接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {number} enable - 启用（0-未启用，1-启用） (Required).
 * @property {number} dayOfWeek - 一周的第几天（周一~周日） (Required).
 * @property {string} rebootTime - 重启时间（02:00:00） (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function autoreboot(data) {
  return request({
    url: '/api/operations/autoReboot',
    method: 'post',
    data: data
  })
}

/**
 * ssh配置接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {number} enable - 启用（0-关闭，1-打开） (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function sshconfig(data) {
  return request({
    url: '/api/operations/sshConfig',
    method: 'post',
    data: data
  })
}

/**
 * 视频参数配置接口
 * @param {object|undefined} [query] - Optional query parameters.
 * @returns {Promise<object>} A promise resolving with the API response.
 * --- Response Properties (resolved object) ---
 * @property {any} videoType - int.
 * @property {any} codecType - string.
 * @property {any} width - int.
 * @property {any} height - int.
 * @property {any} frameRate - int 帧率.
 * @property {any} streamType - int.
 * @property {any} upperBitrate - string.
 */
export function getvideoparam(query) {
  return request({
    url: '/api/video/videoParam',
    method: 'get',
    params: query
  })
}

/**
 * 设置录像计划接口
 * @param {object} data - Request payload (Structure not specified)
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function recordplan(data) {
  return request({
    url: '/api/video/recordPlan',
    method: 'post',
    data: data
  })
}

/**
 * 开始预览接口
 * @param {object} data - Request payload (Structure not specified)
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function startpreview(data) {
  return request({
    url: '/api/video/startPreview',
    method: 'post',
    data: data
  })
}

/**
 * 停止预览接口
 * @param {object} data - Request payload (Structure not specified)
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function stoppreview(data) {
  return request({
    url: '/api/video/stopPreview',
    method: 'post',
    data: data
  })
}

/**
 * 开始录像接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {number} [type] - 录像类型[0-全部，1-raw，2-avi] (Optional).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function startrecord(data) {
  return request({
    url: '/api/video/startRecord',
    method: 'post',
    data: data
  })
}

/**
 * 停止录像接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {number} [type] - 类型[0-全部，1-raw，2-avi] (Optional).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function stoprecord(data) {
  return request({
    url: '/api/video/stopRecord',
    method: 'post',
    data: data
  })
}

/**
 * 视频参数设置接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {number} channelID - 通道号 (Required).
 * @property {string} streamType - 码流类型（main/sub） (Required).
 * @property {string} codecType - 编码类型 (Required).
 * @property {string} [name] - 昵称 (Optional).
 * @property {string} [name] - 昵称 (Optional).
 * @property {string} [name] - 昵称 (Optional).
 * @property {string} [name] - 昵称 (Optional).
 * @property {string} [name] - 昵称 (Optional).
 * @property {string} [name] - 昵称 (Optional).
 * @returns {Promise<object>} A promise resolving with the API response.
 * --- Response Properties (resolved object) ---
 * @property {number} groupid - 用户组id，1：超级管理员；2：普通用户.
 */
export function postvideoparams(data) {
  return request({
    url: '/api/video/videoParam',
    method: 'post',
    data: data
  })
}

/**
 * 获取录像计划接口
 * @param {object|undefined} [query] - Optional query parameters.
 * @returns {Promise<object>} A promise resolving with the API response.
 * --- Response Properties (resolved object) ---
 * @property {boolean} enable - 是否启用.
 * @property {number} recordType - 录像类型.
 * @property {any} scheduleAction - 录像计划.
 * @property {string} dayOfWeek - 周几(Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday).
 * @property {number} id - 编号(1-8).
 * @property {string} startTime - 开始时间.
 * @property {string} endTime - 结束时间.
 */
export function snapshotschedule(query) {
  return request({
    url: '/api/storage/snapshotSchedule',
    method: 'get',
    params: query
  })
}

/**
 * 抓图参数接口
 * @param {object|undefined} [query] - Optional query parameters.
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function snapshotparam(query) {
  return request({
    url: '/api/storage/snapshotConfig',
    method: 'post',
    data: query
  })
}export function getsnapshotparam(query) {
  return request({
    url: '/api/storage/snapshotConfig',
    method: 'get',
    params: query
  })
}

/**
 * 报警输入接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {number} port - 报警IO端口号 (Required).
 * @property {number} type - 报警类型 (Required).
 * @property {string} [name] - 名称 (Optional).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function normalAlarmInConfig(data) {
  return request({
    url: '/api/event/normalAlarmInConfig',
    method: 'post',
    data: data
  })
}export function getnormalAlarmInConfig(data) {
  return request({
    url: '/api/event/normalAlarmInConfig',
    method: 'get',
    query: data
  })
}

/**
 * 普通报警输出接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {number} port - 报警输出IO口 (Required).
 * @property {number} delay - 延时 (Required).
 * @property {number} type - 报警类型 (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function normalalarmoutputconfig(data) {
  return request({
    url: '/api/event/normalAlarmOutputConfig',
    method: 'post',
    data: data
  })
}
export function getnormalalarmoutputconfig(data) {
  return request({
    url: '/api/event/normalAlarmOutputConfig',
    method: 'get',
    query: data
  })
}
export function getnormalAlarmSchedule(data) {
  return request({
    url: '/api/event/normalAlarmSchedule',
    method: 'get',
    query: data
  })
}
export function normalAlarmSchedule(data) {
  return request({
    url: '/api/event/normalAlarmSchedule',
    method: 'post',
    data: data
  })
}
export function getnormalAlarmTrigger(data) {
  return request({
    url: '/api/event/normalAlarmTrigger',
    method: 'get',
    query: data
  })
}
export function normalAlarmTrigger(data) {
  return request({
    url: '/api/event/normalAlarmTrigger',
    method: 'post',
    data: data
  })
}

/**
 * 修改用户密码信息接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {string} username - 用户名 (Required).
 * @property {string} oldPassword - 旧密码 (Required).
 * @property {string} newPassword - 新密码 (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function modifyuserpassword(data) {
  return request({
    url: '/api/user/modifyUserPassword',
    method: 'post',
    data: data
  })
}

/**
 * 用户登录接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {string} username - 用户名 (Required).
 * @property {string} password - 密码 (Required).
 * @returns {Promise<object>} A promise resolving with the API response.
 * --- Response Properties (resolved object) ---
 * @property {string} token - 后续所有请求带上token.
 */
export function login(data) {
  return request({
    url: '/api/user/login',
    method: 'post',
    data: data
  })
}

/**
 * 用户注销登录接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {string} username - 用户名 (Required).
 * @property {string} token - 登录令牌 (Required).
 * @returns {Promise<any>} A promise resolving with the API response.
 */
export function logout(data) {
  return request({
    url: '/api/user/logout',
    method: 'post',
    data: data
  })
}

/**
 * 心跳保活接口
 * @param {object} data - Request payload.
 * --- Request Properties (data) ---
 * @property {string} username - 用户名 (Required).
 * @returns {Promise<object>} A promise resolving with the API response.
 * --- Response Properties (resolved object) ---
 * @property {number} groupid - 用户组id，1：超级管理员；2：普通用户.
 */
export function keepalive(data) {
  return request({
    url: '/api/user/keepalive',
    method: 'post',
    data: data
  })
}
